<template>
	<van-nav-bar left-text="返回" left-arrow @click-left="goback">
		<template #right>
			<van-icon name="search" size="18" />
		</template>
		<template #title>
			{{LineName}}
		</template>
	</van-nav-bar>
	<div class="Box">
		<div class="Camera">
<!--			<iframe src="http://10.112.6.250:8888/api/v2/video" style="width:100%;height:100%"></iframe>-->

			<iframe :src="videoSrc" style="width:100%;height:100%" ></iframe>
		</div>
		<div class="underList">
			<show-device-status></show-device-status>
		</div>
	</div>

</template>

<script>
import router from "@/router";
import ShowDeviceStatus from "@/views/vedioCheck/Line/ShowDeviceStatus.vue";
import {VideoPlay} from "@element-plus/icons-vue";
// import {useStore} from 'vuex';
// const store = new useStore();
export default {
	name: "AllDevices",
	components: {VideoPlay, ShowDeviceStatus},

	data(){
		return{
			LineID:'',
			LineName:'aaaa',
			videoSrc:'http://127.0.0.1:8081/video/?name='
		}
	},
	methods:{
		goback(){
			//console.log('goback')
			router.push({name:'AllLine'})
		}
	},
	mounted(){
		console.log('AllDevices - mounted');
		if(this.$route.query){
			//console.log(this.$route.query)				//打印路由传进来数据
			this.LineID = this.$route.query.LineID			//取出产线ID
			this.LineName = this.$route.query.LineName		//取出产线名称
			this.videoSrc += this.LineName
			// console.log(this.videoSrc)
			//存储当前产线信息
			this.$store.commit("setLineName",{LineName:this.$route.query.LineName,LineID:this.$route.query.LineID})
		}
		this.vedioSrc += this.LineName
	}
}
function get(){
	//console.log('get')
	// let Current = store.state.currentUser
	// console.log(Current)
}
</script>

<style scoped>
.Box{
	display: flex;
	flex-direction: column;
	justify-content: space-around;
	align-items: center;
}
.Camera{
	width:98%;
	height:250px;
	border: cadetblue 1px solid;
}
.underList{
	margin-top: 20px;
	border: cadetblue 1px solid;
}
</style>